package com.jotton.Samples;

import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;


public class AnimationHelper
{
	public static Animation inFromAboveAnimation()
	{
		Animation inFromAbove = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT , 0.0f,
				Animation.RELATIVE_TO_PARENT,-1.0f,Animation.RELATIVE_TO_PARENT , 0.0f
				);
		inFromAbove.setDuration(350);
		inFromAbove.setInterpolator(new AccelerateInterpolator());
		return inFromAbove;

		
	}
	public static Animation outToBottomAnimation()
	{
		Animation outToBottom = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT , 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT ,+1.0f
				);
		outToBottom.setDuration(350);
		outToBottom.setInterpolator(new AccelerateInterpolator());
		return outToBottom;

		
	}

	public static Animation inFromBottomAnimation()
	{
		Animation inFromBottom = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT , 0.0f,
				Animation.RELATIVE_TO_PARENT, +1.0f,Animation.RELATIVE_TO_PARENT , 0.0f
				);
		inFromBottom.setDuration(350);
		inFromBottom.setInterpolator(new AccelerateInterpolator());
		return inFromBottom;
		
	}
	public static Animation outToAboveAnimation()
	{
		Animation outToAboveBottom = new TranslateAnimation(
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT , 0.0f,
				Animation.RELATIVE_TO_PARENT, 0.0f,Animation.RELATIVE_TO_PARENT ,-1.0f
				);
		outToAboveBottom.setDuration(350);
		outToAboveBottom.setInterpolator(new AccelerateInterpolator());
		return outToAboveBottom;
		
	}

	//for the previous movement
	public static Animation inFromRightAnimation() {

    	Animation inFromRight = new TranslateAnimation(
    	Animation.RELATIVE_TO_PARENT,  +1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
    	Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	);
    	inFromRight.setDuration(350);
    	inFromRight.setInterpolator(new AccelerateInterpolator());
    	return inFromRight;
    	}
    public static Animation outToLeftAnimation() {
    	Animation outtoLeft = new TranslateAnimation(
    	 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  -1.0f,
    	 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	);
    	outtoLeft.setDuration(350);
    	outtoLeft.setInterpolator(new AccelerateInterpolator());
    	return outtoLeft;
    	}    
    // for the next movement
    public static Animation inFromLeftAnimation() {
    	Animation inFromLeft = new TranslateAnimation(
    	Animation.RELATIVE_TO_PARENT,  -1.0f, Animation.RELATIVE_TO_PARENT,  0.0f,
    	Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	);
    	inFromLeft.setDuration(350);
    	inFromLeft.setInterpolator(new AccelerateInterpolator());
    	return inFromLeft;
    	}
    public static Animation outToRightAnimation() {
    	Animation outtoRight = new TranslateAnimation(
    	 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,  +1.0f,
    	 Animation.RELATIVE_TO_PARENT,  0.0f, Animation.RELATIVE_TO_PARENT,   0.0f
    	);
    	outtoRight.setDuration(350);
    	outtoRight.setInterpolator(new AccelerateInterpolator());
    	return outtoRight;
    	}

	}